package com.rich.house.controller;

import com.rich.common.result.ResultData;
import com.rich.house.service.HouseRingService;
import com.rich.house.vo.AddHoueseRingVo;
import com.rich.house.vo.SearchUidListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author:fei
 * @Date:2021/8/13
 */
@RestController
@RequestMapping("/houesering")
public class HoueseRingController {

    @Autowired
    private HouseRingService houseRingService;
    /**
     * 楼市圈列表
     */
    @PostMapping("/hringList")
    public ResultData hringList(@RequestBody SearchUidListVo uidListVo){
        return houseRingService.searchUidList(uidListVo);
    }

    /**
     * 删除动态
     * @param id,uid
     * @return
     */
    @GetMapping("/delete/{id}/{uid}")
    public boolean deleteOne(@PathVariable("id")Integer id,@PathVariable("uid")Integer uid){
        return houseRingService.deleteOne(id,uid);
    }
    /**
     * 发布动态
     */
    @PostMapping("/addHoueseRing")
    public void addHoueseRing(@RequestBody AddHoueseRingVo addHoueseRingVo){
        try {
            houseRingService.addHoueseRing(addHoueseRingVo);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}
